using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace TongJi_EMS._Event
{
    public class EventLogWriter
    {
        public static void WriteEvent(string p_source, string p_info, EventLogEntryType p_infoType)
        {
            try
            {
                EventLog.WriteEntry(p_source, p_info, p_infoType);
            }
            catch (System.ComponentModel.Win32Exception e)
            {
                if (e.NativeErrorCode == 1502)
                {
                    //When the specified eventlog is full, it should be truncated or backuped
                    //Right now, we do nothing to prevent more following errors
                }
            }
        }
    }
}
